home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr28
/
alogin21.zip
/
ALOGIN.DOC
< prev
next >
Wrap
Text File
|
1993-05-07
|
18KB
|
370 lines
AutoLogin
The automated login program for the LANtastic Network Operating System.
"Real programmers don't write specs - users should consider
themselves lucky to get any programs at all and take what they get."
- From "Real Programmers Don't Write Specs"
In just a moment, I'll start right in to the documentation, but first,
here's a word, or I should say many words, that I have to tell you:
Yes, I wrote this program, and I have found that it works fine on my
computer in my office. If, for some very odd reason, it does not work on
yours; or further, if it causes damage to your system for any reason,
I will assume NO responsibility for such damages. Also, noting that the
programmer was an employee of Artisoft, Inc. until May 14, 1993, note that
Artisoft is not responsible for the contents of this documentation
file; the functioning of the program which this documentation
describes (or any damages resulting from the use or misuse of the
program); and further, Artisoft Technical Support and other employees
of Artisoft, Inc. are NOT RESPONSIBLE FOR SUPPORTING THIS PROGRAM.
If you have problems or suggestions when using this program, direct
them to the author, J Gerring, using ONLY the following methods:
US Mail: 5500 N. Valley View #108, Tucson, AZ 85718
CompuServe Email: 73650,471 (best way)
Do not call the author during business hours for support, this program was
not written during business hours, it will not be supported during
business hours.
Which leads me to the following: The ALOGIN program is hereby declared
Public Domain (starting with version 1.2) and the source code is included.
You may freely use it, distribute it as the file ALOGIN.ZIP (containing
the files ALOGIN.EXE, AUTOLOG.EXE, ALOGIN.DOC and ALOGIN.C) and give as many
copies to your friends as you like. If you find it useful, fun, and
interesting, drop me an email or a postcard and say thanks! This program is
copyrighted, so if you are interested in using any part or all of the source
code in your own programs, please contact me for licensing. In fact, you
probably would be better off purchasing Artisoft's LANtastic LPI (LANtastic
Programmer's Interface) product instead, since it handles all of the low-level
DOS interrupts for logins, uses, etc. for you. But if you like to read source
code, here it is!
Yet another Note:
Previous versions of ALOGIN were designated as shareware. I changed my
mind. Anybody could write this program, I just happened to take a weekend
out to do it. Consider any earlier versions Public Domain also, but you
should probably upgrade to this version anyway. Alogin was compiled under
the Microsoft(R) C/C++ complier, version 7.0.
-----------------------------------------------------------------------------
Release History:
10-1-89 - First release of program.
v1.0 10-2-89 - Modified program to continue processing after encountering
an invalid command statement in user's data file. Ok,
but at least I found this one before it was pointed out...
(this release says "AutoLogin 1.0 ..." in opening
message, previous version did not.)
v1.1 10-13-89 - Added multiple adapter support. Previously, AutoLogin
would only work on adapter 0. See documentation for
further details.
v1.2 02-09-90 - Fixed a minor bug in the parser, re-designated the
thing as Public Domain, and gave you the source code
so you can fix the rest of the bugs! (just kidding,
if you find any, please let me know.)
v2.0 03-14-93 - Wow, long time, no updates! Ok, here's a new version.
This version adds the WAITFOR "verb," which is used in
place of the LOGIN verb so ALOGIN will wait for a server
to come on line. Hitting ESCape cancles the wait. See
main text for details. This version also has significantly
better and more readable source code.
v2.1 05-07-93 - Added the new AUTO verb, which is used to turn on and off
the LANtastic Auto-login feature. ALOGIN also now turns
Auto-login off at the start of the program. More details in
the main text.
Also, ALOGIN now checks to make sure the LANtastic
redirector (REDIR) is running before it trys to do any
network calls. There were also a few minor bug fixes and
cosmetic changes made to this version. It's probably the
last version I'll distrubute.
-----------------------------------------------------------------------------
Ok, here's the documentation! (finally...)
OVERVIEW (or, after writing a program, how do I tell you about it?)
Note that this documentation file assumes that the reader has some
experience with the LANtastic Network Operating System. If you're
a brand new user, I'd suggest reading up on LANtastic first. The function of
ALOGIN is to provide an easy interface for logging into, and using devices
on LANtastic servers from the workstation (or redirector). In general, it
does this by accepting a username and a password as keyed input then
reading a data file which the system administrator (or whoever) has set up
for the specified username. Details follow:
SETTING UP (there's always a setup, but don't be paranoid...)
Before you run ALOGIN, you need to set up a data file for the user. This
file is just an ASCII file which you need to locate in your \LANTASTI file
directory. ALOGIN determines the file name by the following algorithm:
if username (entered at run time) is less than 9 characters then
filename = \LANTASTI\username.DAT
else
concatonate first 4 characters of username with last 4
characters and
filename = \LANTASTI\username[1 to 4]+username[n-4 to n].DAT
Examples:
username entered filename extracted
---------------- ------------------
MARK MARK.DAT
$MANAGER $MANAGER.DAT
PROGRAMMER PROGMMER.DAT
ADMINISTRATION1 ADMIION1.DAT
---------------------------------------------------
Note: The above algorithm is used by ALOGIN.EXE. On a large LAN, such as
Artisoft's, you may not want to try to maintain a bunch of very similar
configuration files that have different names across the LAN. For that reason,
I have included a special version of ALOGIN v2.1 called AUTOLOG.EXE. It uses
the hardwired name \LANTASTI\ALOGIN.DAT for the input file, but still uses the
username and password you enter at run time to do logins. That way, you don't
have to remember everybody's username, you can just copy your default
ALOGIN.DAT file to their computer. AUTOLOG.EXE displays v2.1a as its version
number.
Now that you know how the filename is extracted, then get into your
favorite word processing program and create an ASCII username.DAT file
following these easy rules:
1. Basic rule of thumb: ALOGIN processes NET LOGIN or NET USE
type statements. Statments are entered one (1) per line, with the
NET part omitted.
1a. As of version 2.0, the WAITFOR statement is supported. This
is formatted exactly like a LOGIN statment, where WAITFOR replaces
LOGIN.
1b. As of version 2.1, the AUTO verb is now supported. Options for AUTO
are ON or OFF. This command either sets the LANtastic Auto-login
name and password to the name and password you entered at the prompts
(that's the ON choice) or disables Auto-login (the OFF choice). See
rule 6b for more info.
2. If you feel like putting in a comment, start the line with a
semicolon character (;).
3. Put in as many blank lines and other white space characters BETWEEN
statement lines as you like.
4. Don't put comments on the same line as a command statment.
5. Don't put extra arguments on a statement line, or you will get an
error message from ALOGIN concerning that line.
6. LOGIN lines contain only the server name and an optional
adapter number, ALOGIN assumes that the user has the same
password on each server. (note: this
was done to create tight security; you don't have your password
published in an easily readable .BAT or .DAT file anywhere. If you
don't use passwords, just hit the enter key when ALOGIN prompts
you for password.) If an adapter number is not entered, ALOGIN
will attempt the login on all possible adapters, starting with
adapter 0. If an adapter number is specified, ALOGIN will
attempt to login to that server ONLY on that adapter number. Note
that ALOGIN will run faster if you specify the adapter number, so if
you just have one adapter in your computer you may want to put the
adapter number 0 at the end of each LOGIN line.
DO NOT enter the '\\' in front of the server name on the LOGIN line.
E.g. LOGIN TECHDATA is right, LOGIN \\TECHDATA is wrong.
6a. WAITFOR lines are just like LOGIN lines including the optional
adapter number. The only difference is that when ALOGIN encounters
a WAITFOR it will keep trying to log you into that server until
(a) it succeeds or (b) you hit ESCape key and cancel it. If you
cancel, ALOGIN displays a message to let you know it's stopped
trying to find that server and then continues processing with the
next line in the data file.
6b. AUTO lines contain the word AUTO followed by either ON or OFF.
AUTO ON enables LANtastic's Auto-login feature with the username and
password you entered at the prompts. AUTO OFF disables the Auto-
login feature. When it starts, ALOGIN turns off LANtastic's Auto-
login, so you will need to turn it on if you want to use it.
This only works on LANtastic NOS version 4.1 and above, as
the Auto-login feature did not exist in earlier versions. The
advantage to setting AUTO ON in your ALOGIN data file is that you
don't need to use LOGIN statements from that point on in the file,
you can just use USE commands and LANtastic will take care of the
LOGINs. It also means that any NET USE commands you issue later
will use the username and password you entered here, which should
be the ones you want to use. By default the LANtastic redirector
uses your machine (the name specified on the REDIR command line)
name as the Auto-login user name without a password, which is
probably not what you want it set to if you are using ALOGIN. If
this discussion of the AUTO verb seems confusing, read the section
in your LANtastic NOS manual about Auto-login and it should all
become clear to you! Also, check out the example below.
7. USE lines are done just like you were typing them into the
keyboard or in a BAT file, but without the NET part.
Here's a (real live) example file:
;top of file
;This file logs me into all the machines on the network that I want to use.
;Additionally, I can write a whole novel of comments!
;login to techdata
login techdata
use f: \\techdata\rootd
use g: \\techdata\root
use m: \\techdata\rootd
;login to Lu's machine, try login only on adapter 1
login lka 1
use lpt1 \\lka\@laser
;wait for TE_LASER to come on line then log in.
waitfor te_laser
use lpt2 \\te_laser\@printer
use l: \\lka\root
;do bbs login
login bbs
use n: \\bbs\root
use o: \\bbs\rootd
login bruce lee
;note that the above line WILL produce an error message!
;end of login file
Here's a file that will get you the same results, but using the AUTO ON verb:
;top of file
;This file logs me into all the machines on the network that I want to use.
;Additionally, I can write a whole novel of comments!
;enable LANtastic Autologin with my username and password
auto on
;login to techdata
use f: \\techdata\rootd
use g: \\techdata\root
use m: \\techdata\rootd
;login to Lu's machine, try login only on adapter 1
login lka 1
use lpt1 \\lka\@laser
;wait for TE_LASER to come on line then log in.
waitfor te_laser
use lpt2 \\te_laser\@printer
use l: \\lka\root
;do bbs uses
use n: \\bbs\root
use o: \\bbs\rootd
;end of login file
Note that you can still use LOGIN and WAITFOR commands when AUTO is ON.
RUNNING ALOGIN (one small set of keystrokes for humankind...[apol. to N.A.])
Quite simple: Just type it in at the command line or put it in a batch file.
I will mention a couple of things. First, as noted before, ALOGIN will prompt
you for a USERNAME and a PASSWORD. The assumption is that you use the same
username and password across the LAN. If this is not true, you will need to
create a \LANTASTI\username.DAT file for each username that you use on the LAN
and invoke ALOGIN multiple times. Or, you can make it easy on yourself and use
the same username across the LAN... If you have different passwords on each
server, the best solution is to change them all to be the same, it will save
you a lot of headaches! There are two basic Ideas behind the function of
ALOGIN:
1) To make it easy and fast to login to more than 1 server while providing
good security. ALOGIN prompts for a password (and echos *s) so that you
don't have to prompt for it on each NET LOGIN line of a batch file.
(which you should be doing if security matters at all on your LAN) The USE
part of the program was thrown in for completeness. The WAITFOR and AUTO parts
were added because they make sense for LANtastic versions 4.1 and higher.
2) To make it easy for different people who are using the same workstation
at different times to obtain access to those resources that they need to
access. For example, say you have a part-time payroll accountant and a
part-time student programmer who work for the same company. They share
the same machine and office (they work non-overlapping hours, of course),
and obviously need access to very different resources - and you may not
want them to have access to each others resources. Maybe the programmer
is paranoid that her programs might be "missing" one day... So, create
ALOGIN data files for each one and you've headed off some potential
problems! AND maintained security. Wow!
WHAT HAPPENS NEXT (or "to function correctly or not to function crrecly")
[apol. to you-know-who]
Ok, so, you create your data file, run ALOGIN, and enter the username and
password. Did it work? Here's how you know...
ALOGIN displays messages in the following order:
Opening message: --- AutoLogin for LANtastic (tm) ---
(c) J Gerring 1990, 1993
Username prompt: Enter username:
Password prompt: password:
Then, when you hit enter, it checks to make sure the LAN is there and aborts if
not, setting the DOS ERRORLEVEL to 2. Then, it tries to open the data file for
the username you entered (or, if you're using AUTOLOG.EXE, it tries to open
\LANTASTI\ALOGIN.DAT). If no file exists, you'll hear about it - this is
another aborting error condition, bad lines in the .DAT file produce error
messages, but processing of the file continues. If ALOGIN dies due to a
non-existant data file (say, if you mistakenly type MMARK for your user name),
the ERRORLEVEL is conveniently set to 1. Next, it begins executing the
statements from the data file, displaying info about what it's doing along the
way. You'll get messages which indicate success or failure of the data file
statments. To explain, here's a complete capture of the screen output of an
ALOGIN run based on the first example data file above:
--- AutoLogin for LANtastic (tm) ---
(c) J Gerring 1990, 1993
Enter username: $jag
password: *****
LANtastic Auto-login feature disabled
Logging in...
Logged into: TECHDATA
Device F: redirected to \\TECHDATA\ROOTD
Device G: redirected to \\TECHDATA\ROOT
Device M: redirected to \\TECHDATA\ROOTD
Error logging into LKA -> Duplicate redirection or login to network node LKA
Error redirecting LPT1 -> Duplicate redirection or login to network node LKA
Trying to login to server TE_LASER. Press ESC to cancel retrys.
Logged into: TE_LASER
Device LPT2: redirected to \\TE_LASER\@PRINTER
Error redirecting L: -> Duplicate redirection or login to network node LKA
Error logging into BBS -> Cannot locate network name
Error redirecting N: -> Path not found
Error redirecting O: -> Path not found
Warning: Badly formatted LOGIN statement ->LOGIN BRUCE LEE<-
Login finished!
Note: if I'd used the AUTO ON command in my username.DAT file, you'd see the
message "LANtastic Auto-login enabled with username $JAG" in the output.
A LITTLE TROUBLE SHOOTING (although they are often difficult targets)
Generally, your output should look like the first 4 message lines of the
above example for each login and redirection in the data file (starting
with the line "Logged into: TECHDATA"). If you see error messages (as in
the above example), these are the most common reasons:
1) The server specified in the LOGIN statement is not powered on.
2) Specified server is not currently running LANtastic.
3) Specified server is not running the LANtastic SERVER program.
4) You are already logged into that server, or have already redirected the
specified device.
THE END